CC = gcc
AR = ar cru
SRC = antx/antx.cc antx/thread.cc antx/exmonwaiter.cc  antx/clientAcl.cc helper/Helper.cc

CFLAGS = -Wall -D_REENTRANT -D_GNU_SOURCE -DLINUX -fPIC  -g3  -O2  
SOFLAGS = -shared
LDFLAGS =   # -lresolv

LINKER = $(CC)
LINT = lint -c
RM = /bin/rm -f

LIBS = -L/home/y/lib -L/usr/local/lib -L/usr/lib  \
	    -pthread -lstdc++  -levent -lmemcached

INCLUDES =  -I/home/y/include -I/usr/local/include -I. -I/usr/include  -I./antx  -I./helper 

OPTFLAG =  -D_DEBUG -fno-default-inline 

CFLAGS  += $(INCLUDES) 
CFLAGS  += $(OPTFLAG) 
LDFLAGS += $(LIBS) 
#--------------------------------------------------------------------
OBJS = $(SRC:.cc=.o)
TARGET = antxD
#--------------------------------------------------------------------
all:$(TARGET)
$(TARGET):$(OBJS)
	$(LINKER) $(LDFLAGS) $(OPTFLAG) $(OBJS)  -o $@

clean:
	@( $(RM) *.o vgcore.*  $(TARGET) )
	rm ./antx/*.o ./helper/*.o  
#--------------------------------------------------------------------
# make rule
%.o : %.cc
	$(CC) $(CFLAGS) -c $^ -o $@	

%.o : %.cpp
	$(CC) $(CFLAGS) -c $^ -o $@	

